<?php

namespace App\Http\Requests\Docs;

use App\Http\Requests\BaseRequests;

class DocsRequests extends BaseRequests
{
    public function rules()
    {
        $rules = [
            'name'        => 'required|string',
            'icon'        => 'url',
            'description' => 'string | max:255|min:10',
        ];
        return $rules;
    }

    public function attributes()
    {
        $attributes = [
            'name'        => '文档名称',
            'icon'        => '图标',
            'description' => '文档描述',
        ];
        return $attributes;
    }

    public function messages()
    {
        $message = [
            'required' => ':attribute不得为空',
            'string'   => ':attribute必须是字符',
            'url'      => ':attribute不行是url类型',
            'max'      => ':attribute不得超过:max',
            'min'      => ':attribute不得小于:min',
        ];
        return $message;
    }
}